cmake_minimum_required(VERSION 3.22 FATAL_ERROR)

project(custom LANGUAGES CXX)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

cmake_policy(SET CMP0075 NEW)
cmake_policy(SET CMP0077 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
cmake_policy(SET CMP0135 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)

set(MY_LIBS)
set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../.dep)
include(FetchContent)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/FetchLua.cmake)
FetchContent_MakeAvailable(lua)

add_library(${PROJECT_NAME} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/custom.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE lua)
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")

# add_executable(test ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
# target_link_libraries(test PRIVATE lua custom)